define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echarts-theme', 'template'], function ($, undefined, Backend, Datatable, Table, Echarts, undefined, Template) {

    var Controller = {
        index: function () {
			require(['bootstrap-datetimepicker'], function () {
                var options = {
					format: 'YYYY',
					icons: {
						time: 'fa fa-clock-o',
						date: 'fa fa-calendar',
						up: 'fa fa-chevron-up',
						down: 'fa fa-chevron-down',
						previous: 'fa fa-chevron-left',
						next: 'fa fa-chevron-right',
						today: 'fa fa-history',
						clear: 'fa fa-trash',
						close: 'fa fa-remove'
					},
					showTodayButton: true,
					showClose: true
				};
				$('.datetimepicker').datetimepicker(options).on('dp.change', function (e) {
					$(this, document).trigger("changed");
				}).attr('disabled', false);
			});			
			$(document).on("click", ".jumpProject", function () {
			    var type = $(this).data('type');
				var year = $(this).data('year');
				var status = $(this).data('status');
				var url = '/admin/project/index?ref=addtabs';
				if(type)
				{
					url = url +'&type='+type;
				}
				if(year)
				{
					url = url +'&year='+year;
				}
				if(typeof status != 'undefined')
				{
					url = url +'&status='+status;
				}
				Backend.api.addtabs(url, '项目列表');
			});
        }
    };

    return Controller;
});
